package com.album.task;

import android.content.Context;

import com.album.http.HttpRequest;
import com.album.utils.Config;

public class ModifyPicTask extends Task{
	public String TAG = "DelPicinfoTask";
	private Context ctx;
	private ICallBack callBack;
	private String username; 
	private String picId;
	private int type; 
	private int attribute;
	
	public ModifyPicTask(Context ctx,String username,String picId,int type,int attribute,ICallBack resTask){
		this.ctx = ctx;
		this.callBack = resTask;
		this.username = username;
		this.picId = picId;
		this.type = type;
		this.attribute = attribute;
	}

	public String setRequest(){
		String strUrl =Config.TyHttp +Config.TyPicHttp+
		"modifpic?passport="+username+
		"&picId="+picId+
		"&type="+type+
		"&attribute="+attribute;
		String jsonString = HttpRequest.sendDataPost(ctx,strUrl, null,callBack);
		return jsonString;
	}
	@Override
	public void doTask(Task thread){
		Thread t = new Thread(thread);
		t.start();
	}
	@Override
	public void run() {
		//返回数据
		try {
			String strRsp = setRequest();
			callBack.CallBack(strRsp);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}